using System;
using System.Collections;
using System.Xml;
using Altova.TypeInfo;
using Altova.Xml;
using Altova.Xml.Meta;

namespace RDML_v1_2_REC.rdml
{
	public class cqDetectionMethodTypeType : TypeBase
	{
		internal class Enumerator : EnumeratorBase
		{
			public override object Current
			{
				get
				{
					return new cqDetectionMethodTypeType((XmlNode)base.InnerCurrent);
				}
			}

			public Enumerator(IEnumerator inner)
				: base(inner)
			{
			}
		}

		public enum EnumValues
		{
			eautomated_threshold_and_baseline_settings = 0,
			emanual_threshold_and_baseline_settings = 1,
			esecond_derivative_maximum = 2,
			eother = 3,
			Invalid = -1
		}

		public static ComplexType StaticInfo
		{
			get
			{
				return new ComplexType(RDML_v1_2_REC_TypeInfo.binder.Types[RDML_v1_2_REC_TypeInfo._altova_ti_rdml_altova_cqDetectionMethodTypeType]);
			}
		}

		public EnumValues EnumerationValue
		{
			get
			{
				MemberInfo member = RDML_v1_2_REC_TypeInfo.binder.Members[RDML_v1_2_REC_TypeInfo._altova_mi_rdml_altova_cqDetectionMethodTypeType_altova_unnamed];
				return (EnumValues)TypeBase.GetEnumerationIndex(member, XmlTreeOperations.CastToString(base.Node, member), 0, 4);
			}
			set
			{
				MemberInfo memberInfo = RDML_v1_2_REC_TypeInfo.binder.Members[RDML_v1_2_REC_TypeInfo._altova_mi_rdml_altova_cqDetectionMethodTypeType_altova_unnamed];
				if (value >= EnumValues.eautomated_threshold_and_baseline_settings && value < (EnumValues)4)
				{
					XmlTreeOperations.SetValue(base.Node, memberInfo, memberInfo.DataType.facets[(int)value].stringValue);
					return;
				}
				throw new IndexOutOfRangeException();
			}
		}

		public string Value
		{
			get
			{
				MemberInfo member = RDML_v1_2_REC_TypeInfo.binder.Members[RDML_v1_2_REC_TypeInfo._altova_mi_rdml_altova_cqDetectionMethodTypeType_altova_unnamed];
				return XmlTreeOperations.CastToString(base.Node, member);
			}
			set
			{
				MemberInfo member = RDML_v1_2_REC_TypeInfo.binder.Members[RDML_v1_2_REC_TypeInfo._altova_mi_rdml_altova_cqDetectionMethodTypeType_altova_unnamed];
				XmlTreeOperations.SetValue(base.Node, member, value);
			}
		}

		public cqDetectionMethodTypeType(XmlNode init)
			: base(init)
		{
			instantiateMembers();
		}

		private void instantiateMembers()
		{
		}

		public void SetXsiType()
		{
			XmlTreeOperations.SetAttribute(base.Node, "xsi:type", "http://www.w3.org/2001/XMLSchema-instance", new XmlQualifiedName("cqDetectionMethodType", "http://www.rdml.org"));
		}
	}
}
